
local function IsCinematicButtonDisabled()

    if( DoesWindowExist( "PreloginBackgroundCinematicButton" ) and ButtonGetDisabledFlag( "PreloginBackgroundCinematicButton" ) == true )
    then
        return true
    end
    
    if( DoesWindowExist( "QuickStartWindowCinematicButton" ) and ButtonGetDisabledFlag( "QuickStartWindowCinematicButton" ) == true )
    then
        return true
    end

end


function PregameOpenCinematicWindow()
    if( IsCinematicButtonDisabled() )
    then
        return
    end
    WindowSetShowing("EA_Window_CinematicDisplay", true)
    PregamePlayCinematic()
end

function PregameCloseCinematicWindow()
    if( IsCinematicButtonDisabled() )
    then
        return
    end
    WindowSetShowing("EA_Window_CinematicDisplay", false)
    PregameStopCinematic()
end

function PregameToggleCinematicWindow()
    if( IsCinematicButtonDisabled() )
    then
        return
    end
        
    if (WindowGetShowing("EA_Window_CinematicDisplay"))
    then
        PregameCloseCinematicWindow()
    else
        PregameOpenCinematicWindow()
    end
end